import React, { Component } from "react";
export default class PageHeader extends Component{
  constructor(props){
    super(props);
    this.state = {
    }
  }
  loopHtmlFun(item){
    var len = item.length -1;
    return <p className='crumb'>{
      item.map((el, index) =>{
        return <React.Fragment key={index}><span>{el}</span>
               {len===index ? '':<i>&gt;</i>}</React.Fragment>
      })
    }</p>
  }
  render(){
    var _this = this,
        pageDate = _this.props.data;
    return(
      <div className="page-header">
        <div className="container-fluid">
          <h1>{pageDate.title}</h1>
          {_this.loopHtmlFun(pageDate.crumb)}
        </div>
      </div>
    );
  }
}